{include file="public/header"/}
<style>
	body {
		overflow-y: auto;
	}

	.wrapper {
		margin-bottom: 4px
	}

	.grid-wrap p {
		margin: 5px 0;
	}

	#tree {
		background-color: #fff;
		width: 225px;
		border: solid #ddd 1px;
		margin-left: 5px;
		height: 100%;
	}

	h3 {
		background: #EEEEEE;
		border: 1px solid #ddd;
		padding: 5px 10px;
	}

	.grid-wrap {
		position: relative;
	}

	.grid-wrap h3 {
		border-bottom: none;
	}

	.grid-wrap .ui-btn {
		margin-left: 10px;
	}

	#tree h3 {
		border-style: none;
		border-bottom: solid 1px #D8D8D8;
	}

	.quickSearchField {
		padding: 10px;
		background-color: #f5f5f5;
		border-bottom: solid 1px #D8D8D8;
	}

	#searchCategory input {
		width: 165px;
	}

	.innerTree {
		overflow-y: auto;
	}

	#hideTree {
		cursor: pointer;
		color: #fff;
		padding: 0 4px;
		background-color: #B9B9B9;
		border-radius: 3px;
		position: absolute;
		top: 5px;
		right: 5px;
	}

	#hideTree:hover {
		background-color: #AAAAAA;
	}

	#clear {
		display: none;
	}

	.ztree li span.button.add {
		margin-left: 2px;
		margin-right: -1px;
		background-position: -144px 0;
		vertical-align: top;
	}

	.url-box {
		margin-right: 5px;
		margin-left: 20px;
	}

	h3 span {
		font-weight: normal;
	}

	.grid-wrap .ui-jqgrid {
		padding-bottom: 50px;
	}
</style>

<div class="wrapper">

	<div class="mod-toolbar-top cf">
		<div class="fl">
			<strong class="tit">计量单位</strong>
		</div>
	</div>
	<div class="cf">
		<div class="">
			<div class="grid-wrap">
				<h3>单计量单位<a href="#" class="ui-btn ui-btn-add" id="btn-add"
						onclick="lopen('add.html','新增', '520px', '400px')">新增</a>
					<!-- <a class="ui-btn ui-btn-normal" id="btn-refresh" onclick="reload();">刷新</a></h3> -->
					<table id="grid">
					</table>

					<div id="unitGroupWap">
						<h3>
							多计量单位<a href="#" class="ui-btn ui-btn-add" id="btn-add-group"
								onclick="lopen('multiadd.html','新增', '520px', '400px')">新增</a>
							<!-- <a class="ui-btn ui-btn-normal" id="btn-refresh" onclick="reload();">刷新</a> -->
						</h3>
						<table id="grid1">
						</table>
					</div>

			</div>
		</div>
	</div>

	<script type="text/javascript">

		//$(function(){
		$(document).ready(function () {
			//alert("1111");
			$("#grid").jqGrid({
				url: '/admin/unit/index.html?ajax=100',
				datatype: "json",//数据来源，本地数据（local，json,jsonp,xml等）
				height: '90%',//高度，表格高度。可为数值、百分比或'auto'
				//width: Public.setGrid().w,
				//height: Public.setGrid().h,
				colNames: ["操作", "名称"],
				colModel: [
					{ name: 'id', index: 'id', width:70, formatter: cLink },
					{ name: 'name', width:200 },
				],
				rowNum: 10,
				rowList: [10, 20, 30],
				sortname: 'id',
				sortorder: "desc",
				pagerpos: "left",//分页位置

				pgbuttons: true,//翻页按钮
				pagination: true,
				altRows: !0,
				gridview: !0,
				shrinkToFit: !1,
				cellLayout: 8,
				autowidth: !0,
				pager: "#page",
				viewrecords: !0,
				cmTemplate: {
					sortable: !1,
					title: !1
				},
				loadError: function (t, e, i) {
					parent.Public.tips({
						type: 1,
						content: "操作失败了哦，请检查您的网络链接！"
					})
				}
			});

		});

		function cLink(cellvalue, options, rowObject) {
			return '<div class="operating"><span class="ui-icon ui-icon-pencil" onclick="lopen(\'edit.html?id=' + rowObject.id + '\',\'编辑\',\'520px\',\'400px\')" title="修改"></span><span class="ui-icon ui-icon-trash" onclick="del(' + rowObject.id + ')" title="删除"></span></div>'
		}
	</script>

	<script type="text/javascript">

		//$(function(){
		$(document).ready(function () {
			//alert("1111");
			$("#grid1").jqGrid({
				url: '/admin/unit/multiindex.html?ajax=100',
				datatype: "json",//数据来源，本地数据（local，json,jsonp,xml等）
				height: '90%',//高度，表格高度。可为数值、百分比或'auto'
				//width: Public.setGrid().w,
				//height: Public.setGrid().h,
				colNames: ["操作", "名称"],
				colModel: [
					{ name: 'id', index: 'id', width:70, formatter: cLink1 },
					{ name: 'super_name', width:200 },
				],
				rowNum: 10,
				rowList: [10, 20, 30],
				sortname: 'id',
				sortorder: "desc",
				pagerpos: "left",//分页位置

				pgbuttons: true,//翻页按钮
				pagination: true,
				altRows: !0,
				gridview: !0,
				shrinkToFit: !1,
				cellLayout: 8,
				autowidth: !0,
				pager: "#page1",
				viewrecords: !0,
				cmTemplate: {
					sortable: !1,
					title: !1
				},
				loadError: function (t, e, i) {
					parent.Public.tips({
						type: 1,
						content: "操作失败了哦，请检查您的网络链接！"
					})
				}
			});

		});

		function cLink1(cellvalue, options, rowObject) {
			return '<div class="operating"><span class="ui-icon ui-icon-pencil" onclick="lopen(\'multiedit.html?id=' + rowObject.id + '\',\'编辑\',\'520px\',\'400px\')" title="修改"></span><span class="ui-icon ui-icon-trash" onclick="del(' + rowObject.id + ')" title="删除"></span></div>'
		}
	</script>

	{include file="public/footer"/}